<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <h1>默认插槽</h1>
    <p>这是父组件</p>

    <hr>

    <!-- 
      <slot>xxx</slot>标签的中间可以写内容,写的内容可以作为插槽的默认值
    -->
    <child>2333</child>
  </div>

  <script src="../Vue.js"></script>

  <script>
    const { createApp } = Vue;

    const Child = {
      template: `
        <div>
          <p>这是子组件</p>  
          <slot>456</slot>
        </div>
      `,
    }
    
    const app = createApp({
      data() {
        return {}
      },
      methods: {},
      components: {
        Child
      }
    })

    app.mount("#app")
  </script>
</body>
</html>